<template>
  <div>
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleFormRef"
      label-width="100px"
    >
      <el-form-item label="绑定手机" prop="phone">
        <el-input v-model="ruleForm.phone" placeholder="请输入手机号"></el-input>
      </el-form-item>
      <el-form-item label="绑定邮箱" prop="email">
        <el-input v-model="ruleForm.email" placeholder="请输入邮箱"></el-input>
      </el-form-item>
      <el-form-item>
          <el-button type="primary">一键绑定</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
    data() {
        return {
            ruleForm:{
                phone:'',
                email:''
            },
            rules:{
                phone:[
                    {pattern:/^1[3|4|5|8][0-9]\d{4,8}$/,message:'手机格式不正确',trigger:'blur'}
                ],
                email:[
                    {type:'email',message:'邮箱格式不正确',trigger:'blur'}
                ]
            }
        }
    },
}
</script>

<style lang="less" scoped>
    
</style>